package org.example.service;

import org.example.service.impl.TimeseriesService;
import org.example.util.SpringContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.Callable;
public class QueryDataTask implements Callable<Map<String,Object>> {
    private String uuid;
    private String token;
    TimeseriesService timeseriesService;

    public QueryDataTask(String uuid, String token) {
        this.uuid = uuid;
        this.token = token;
        this.timeseriesService= SpringContext.getBean(TimeseriesService.class);
    }

    @Override
    public Map<String,Object> call() throws Exception {
        return timeseriesService.getTimeseries(uuid, token);
    }
}
